<template>
  <div class="app">
    <h3>我是APP组件,{{car.name}}--{{car.price}}</h3>
    <Child />
  </div>
</template>

<script>
import { reactive,provide } from "vue";
import Child from "./components/Child.vue";

export default {
  name: "App",
  components: { Child },
  setup() {
    let car = reactive({
      name: "奔驰",
      price: "40W",
    });
    provide('car',car);// 给自己后代组件传递数据
    return { 
      car,
    };
  },
};
</script>

<style scoped>
.app {
  background-color: gray;
  padding: 10px;
}
</style>
